package com.mapper;

import com.pojo.Clas;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
* @author 霞
* @description 针对表【c_class】的数据库操作Mapper
* @createDate 2024-11-20 10:40:59
* @Entity com.pojo.Clas
*/
public interface ClasMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Clas record);

    int insertSelective(Clas record);

    Clas selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Clas record);

    int updateByPrimaryKey(Clas record);

    @Select("select * from c_class where id = #{id}")
    @Results({
            @Result(id = true, column = "id",property = "id"),
            @Result(column = "classname",property = "classname"),
            @Result(column = "id",property = "studentsList",
                    many = @Many(select = "com.mapper.StudentsMapper.selectStudentsByUserId"))
    })
    Clas selectClassById(int id);

}
